package com.mobjam.workingtitleforagame;

import android.content.Context;
import android.graphics.Bitmap;


public class Character extends Creature {
	
	protected char itsGender;
	private boolean isBoy;
	protected int itsHP;
	protected int itsMP;
	private int gold = 0;
		
	private static Character characterInstance = null;
	
	public static synchronized Character getInstance()
	{
		if( characterInstance == null )
		{
			characterInstance = new Character();
		}
		
		return characterInstance;
	}

	private Character() {
		super(MapObjectType.GIRLCHARACTER);
		gold = 1000;
	}
	
	public void initCharacter( MapObjectType mapObjectType, int startingGold )
	{
		getInstance().setMapObjectType(mapObjectType);
		getInstance().setGold(startingGold);
	}
	
	public void setGender(char gender){
		itsGender = gender;
	}
	public void setHP(int hp){
		itsHP = hp;
	}
	public void setMP(int mp){
		itsMP = mp;
	}
	
	public char getGender(){
		return itsGender;
	}
	public int getHP(){
		return itsHP;
	}
	public int getMP(){
		return itsMP;
	}
	
	@Override
	public Bitmap getBitmapFrame(int animationFrame)
	{
		if( this.getMapObjectType() == MapObjectType.BOYCHARACTER)
			return MapObject.boyBitmap;
		
		if( animationFrame < 18 )
		{
			return MapObject.girlBitmap;
		}
		
		return MapObject.girlBlinkBitmap;
	}

	public int getGold() {
		return gold;
	}

	public void setGold(int gold) {
		this.gold = gold;
	}
}
